package com.linsir.user;

import com.linsir.aop.AopContext;
import com.linsir.aop.MetaObjectIntercept;
import com.linsir.common.base.BaseController;
import com.linsir.common.utils.EncryptUtil;

/**
 * @author linsir
 * @title: UserIntercept
 * @projectName linsir-mu
 * @description: TODO
 * @date 2021/12/3 23:24
 */
public class UserIntercept extends MetaObjectIntercept {

    @Override
    public String addBefore(AopContext ac) throws Exception {
        // 新增时密码加密储存
        String str = ac.record.getStr("login_pwd");
        ac.record.set("login_pwd", EncryptUtil.getSM32(str));
        return null;
    }
}
